import {request} from "@/utils/http";
import type {CategoryBriefType} from "@/types/product";

/**
 * 获取分类页的所有以及分类列表
 */
export const getCategoryList = () => {
    return request<Array<CategoryBriefType>>({
        url: "/index/category/top",
        method: "GET"
    })
}

/**
 * 获取分类的子分类数据
 * @param id 分类id
 */
export const getCategoryChildrenList = (id: number) => {
    return request<Array<CategoryBriefType>>({
        url: "/index/category/children?id=" + id,
        method: "GET"
    })
}